$(function(){

})

function login(){
    var username = $("#username").val();
    var pswd = $("#pswd").val();
    $.ajax({
        type:"POST",
        url:"/user/login.htm",
        data:{
            userName:username,
            password:pswd
        },
        dataType:"json",
        success: function (data) {
            if (200 == data.resCode){
                window.location.href = data.back_url;
            }else{
                alert(data.resMsg);
            }
        },
        error:function(data){
            alert("网络异常，请稍后重试！");
        }
    })
}